import React from 'react';
import { Route, Switch } from 'react-router-dom';
import LoadableRouter from '@/components/loadableRouter';


const Router = () => {
  return (
    <main>
      <Switch>
        {/* 首页 */}
        <Route path="/" exact component={LoadableRouter(() => import('@/page/home'))} />
        {/* 登录页 */}
        <Route path="/login" component={LoadableRouter(() => import('@/page/login'))} />
        {/* 注册 */}
        <Route path="/register" component={LoadableRouter(() => import('@/page/register'))} />
      </Switch>
    </main>
  )
}

export default Router